package com.whq.mvc.service;

import com.whq.mvc.resp.BusinessException;
import com.whq.mvc.service.model.ItemModel;

import java.util.List;

public interface ItemService {

    public List<ItemModel> listItem();

    public ItemModel getItemById(Integer id);

    public ItemModel getItemByIdInCache(Integer id);

    public boolean decreaseStock(Integer itemId, Integer amount) throws BusinessException;

    public boolean increaseStock(Integer itemId, Integer amount);

    public boolean asyncDecreaseStock(Integer itemId, Integer amount);

    void increaseSales(Integer itemId, Integer amount) throws BusinessException;
}
